<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>res_edit.html</title>
</head>
 <body>
 <script type="text/javascript">
 	var winCommEdit = new Windows("comm_edit");
 	var oCommEdit = {
 		initForm : function(){
 			winCommEdit.find("#commForm").form({
 				url:'$!basePath/admin/common/doEdit',
 				onSubmit: function(){
			    	var pass = winCommEdit.find('#commForm').form("validate");
			    	if(pass){
			    		winCommEdit.find("#ok").linkbutton("loading");
			    	}
			    	return pass; 
			    },   
			    success:function(data){
			   		var result = jQuery.parseJSON(data);
			   		if(result.success == true){
			        	top.Notiy.success("修改成功!");
			        	winCommEdit.setReturnValue(true);
						winCommEdit.close();
			        }else if(result.NoChanges){
			        	top.Notiy.info("您未做任何修改!");
						winCommEdit.close();			        	
			        }else{
			        	top.Dialog.alert("错误",result.error,"error");
			        }

			        winCommEdit.find("#ok").linkbutton("reset");
			    }
 			});
 		},
 		ok : function(){
 			winCommEdit.find('#commForm').submit();
 		},
 		cancel : function(){
 			winCommEdit.close();
 		}
 	};
 	$(function(){
 		var err=winCommEdit.find("#error").val();
	 	if(err){
	 		top.Notiy.success("系统数据不能修改!");
			winCommEdit.setReturnValue(true);
			winCommEdit.close();
	 	}
	 	oCommEdit.initForm();
 	});
 </script>
 <div class="easyui-layout" data-options="fit:true">
	 <div data-options="region:'center',border:false">
	 	<form id="commForm" method="post" style="padding-top:10px;padding-left: 20px;">
	 	<input type="hidden" name="id" value="$!common.id"/>
	 	<input type="hidden" id="error" value="$!error"/>
	 		<table width="90%" >
					<tr>
						<td>标识：</td>
						<td><input type="text" class="easyui-validatebox" name="name"
							maxlength="50" data-options="required:true" style="width: 90%;" value="$!common.name" /></td>
					</tr>
					<tr>
						<td>&nbsp;&nbsp;值：</td>
						<td><input type="text" class="easyui-validatebox" name="value"
							maxlength="50" data-options="required:true" style="width: 90%;" value="$!common.value" /></td>
					</tr>
						<tr>
						<td>类型：</td>
						<td colspan="3">
							<select class="easyui-combobox" name="type" data-options="editable:false,width:207">
								<option value="1">系统数据</option>
								<option value="2">关键数据</option>
								#if($!common.type == 3)
									<option value="3">常规数据</option>
								#end
							</select>
							#setSelectValue("comm_edit","type","$!common.type")
						</td>
					</tr>
					<tr>
						<td>说明：</td>
						<td><textarea class="easyui-textarea" rows="3" cols="21" name="descrip" style="width: 90%;">$!common.descrip</textarea>
						</td>
					</tr>
					
				</table>
		</form>
	 </div>
	 <!--Change Button Text-->
	 <div data-options="region:'south',border:false">
	 	<div class="dialog-button">
			<a id="ok" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="oCommEdit.ok()">确定</a>
			<a id="cancel" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="oCommEdit.cancel()">取消</a>
		</div>
	</div>
 </div>
  </body>
</html>